﻿<%@ Page Title="Employees & Users" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Manage.aspx.cs" Inherits="Timesheet.WebForm.Account.Manage" %>

<%@ Register Assembly="DevExpress.Web.v14.2, Version=14.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <div class="title">
        <dx:ASPxLabel ID="ASPxLabel2" runat="server" CssClass="maintitle" Text="Employees & Users" Font-Size="22px" Font-Bold="true" ForeColor="#4A72A3"></dx:ASPxLabel>
    </div>

    <div class="detail1">

        <dx:ASPxGridView ID="gvUser" runat="server" KeyFieldName="Id" AutoGenerateColumns="False" DataSourceID="odsUser" OnBeforePerformDataSelect="gvUser_BeforePerformDataSelect"
            EnableTheming="True"
            Theme="Office2010Silver"
            SettingsPager-PageSize="15"
            Width="100%"
            Border="0px" OnCustomColumnSort="gvUser_CustomColumnSort" OnCustomErrorText="gvUser_CustomErrorText">
            <Columns>

                <dx:GridViewDataTextColumn FieldName="Id" VisibleIndex="1" Visible="false">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Username" VisibleIndex="4" >
                    <PropertiesTextEdit>
                        <ValidationSettings>
                            <RegularExpression ValidationExpression="\w+([-+.&#39;]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></RegularExpression>
                        </ValidationSettings>
                    </PropertiesTextEdit>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Password" VisibleIndex="5" Width="120px">
                    <PropertiesTextEdit Password="True"></PropertiesTextEdit>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="LastName" VisibleIndex="3" Width="120px">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="FirstName" VisibleIndex="2" Width="120px">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataCheckColumn FieldName="Manager" VisibleIndex="6"  Width="80px">
                    <Settings SortMode="Custom"/>
                </dx:GridViewDataCheckColumn>
                <dx:GridViewDataCheckColumn FieldName="Coordinator" VisibleIndex="7"  Width="90px">
                    <Settings SortMode="Custom"/>
                </dx:GridViewDataCheckColumn>
                <dx:GridViewDataCheckColumn FieldName="TeamLead" VisibleIndex="8" Width="90px">
                    <Settings SortMode="Custom"/>
                </dx:GridViewDataCheckColumn>
                <dx:GridViewDataCheckColumn FieldName="Active" VisibleIndex="9" Width="80px">
                    <Settings SortMode="Custom"/>
                </dx:GridViewDataCheckColumn>

                <dx:GridViewCommandColumn ShowDeleteButton="True" ShowEditButton="True" ShowNewButtonInHeader="True" VisibleIndex="10" Width="125px">
                </dx:GridViewCommandColumn>
            </Columns>
            <SettingsBehavior ColumnResizeMode="Control" ConfirmDelete="true" AllowFocusedRow="True" AllowSelectByRowClick="True" />
            <SettingsPager PageSize="15"></SettingsPager>
            <SettingsEditing Mode="Inline">
            </SettingsEditing>
            <Settings HorizontalScrollBarMode="Hidden" />

            <SettingsCommandButton>
                <UpdateButton ButtonType="Button">
                </UpdateButton>
                <NewButton ButtonType="Button">
                </NewButton>
                <CancelButton ButtonType="Button">
                </CancelButton>
                <EditButton ButtonType="Button">
                </EditButton>
                <DeleteButton ButtonType="Button"></DeleteButton>
            </SettingsCommandButton>
            <Styles>
                <Header HorizontalAlign="Center" Font-Size="Small">
                </Header>
                <AlternatingRow BackColor="#EDF5FF" Enabled="True">
                </AlternatingRow>
                <SelectedRow BackColor="#99CCFF">
                </SelectedRow><FocusedRow BackColor="#99CCFF">
                </FocusedRow>
                <Row Font-Size="11pt" Font-Names="Calibri">
                </Row>
            </Styles>
        </dx:ASPxGridView>
        <asp:ObjectDataSource ID="odsUser" runat="server" DataObjectTypeName="Timesheet.Domain.User"
            DeleteMethod="Delete" SelectMethod="getAllUsersForManagement" TypeName="Timesheet.Service.IUserService"
            UpdateMethod="Update" OnObjectCreating="odsUser_ObjectCreating" InsertMethod="Save">

        </asp:ObjectDataSource>
    </div>
</asp:Content>
